﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Nissen_Resources;

namespace Nissen_Manage.Forms
{
	public partial class ManageMarkSelect : Form
	{
		public ManageMarkSelect()
		{
			InitializeComponent();
		}

		private void btnViewManage_Click(object sender, EventArgs e)
		{
			TestManage testManage = new TestManage();
			testManage.MainForm = this;
			testManage.Show();
			this.Hide();
		}

		private void ManageMarkSelect_FormClosed(object sender, FormClosedEventArgs e)
		{
			Application.Exit();
		}

		private void btnPasswordChange_Click(object sender, EventArgs e)
		{
			PasswordChangeManage passwordChangeManage =new PasswordChangeManage();
			passwordChangeManage.MainForm = this;
			passwordChangeManage.Show();

			this.Hide();
		}

		private void btnClearSSO_Click(object sender, EventArgs e)
		{
			try
			{
				if (MessageBox.Show(ResourceCommon.GetResource("ClearSSOConfrim"), "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
				{
					ManageMarkSelectService manageMarkSelectService = new ManageMarkSelectService();
					manageMarkSelectService.ClearSSO();

					MessageBox.Show(ResourceCommon.GetResource("ClearSSOSuccess"));
				}
			}
			catch (Exception)
			{

				MessageBox.Show(ResourceCommon.GetResource("ClearSSOFail"));
			}
			
		}

		private void ViewManage_Click(object sender, EventArgs e)
		{
			TestManage testManage = new TestManage();
			testManage.MainForm = this;
			testManage.Show();
			this.Hide();
		}

		private void tsmiPasswordChange_Click(object sender, EventArgs e)
		{
			PasswordChangeManage passwordChangeManage = new PasswordChangeManage();
			passwordChangeManage.MainForm = this;
			passwordChangeManage.Show();

			this.Hide();
		}

		private void tsmiSSOClear_Click(object sender, EventArgs e)
		{
			try
			{
				if (MessageBox.Show(ResourceCommon.GetResource("ClearSSOConfrim"), "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
				{
					ManageMarkSelectService manageMarkSelectService = new ManageMarkSelectService();
					manageMarkSelectService.ClearSSO();

					MessageBox.Show(ResourceCommon.GetResource("ClearSSOSuccess"));
				}
			}
			catch (Exception)
			{

				MessageBox.Show(ResourceCommon.GetResource("ClearSSOFail"));
			}
		}

		private void tsmiSSOMapView_Click(object sender, EventArgs e)
		{
			SSOMapViewManage ssoMapViewManage =new SSOMapViewManage();
			ssoMapViewManage.ShowDialog();
		}

		private void tsmiTestCodeMap_Click(object sender, EventArgs e)
		{
			TestMapManage testMapManage = new TestMapManage();
			testMapManage.ShowDialog();
		}

		private void tsmiFileImport_Click(object sender, EventArgs e)
		{
			ManageFileImport manageFileImport = new ManageFileImport();
			manageFileImport.ShowDialog();
		}

		private void tsmiReport_Click(object sender, EventArgs e)
		{
			ManageReport manageReport = new ManageReport();
			manageReport.ShowDialog();
		}

		private void tsmiTestCodeImport_Click(object sender, EventArgs e)
		{
			ManageTestCodeImport manageTestCodeImport = new ManageTestCodeImport();
			manageTestCodeImport.ShowDialog();
		}

		
	}
}
